var divNum = 0; //当前显示的主要div块
var divTalks = document.getElementsByClassName("word-content");
var isContinue=true;
/*for (var i = 0; i < divTalks.length; ++i)
	divTalks[i].style.opacity = 0;
window.onmousewheel = function(e) { //鼠标滚轮滚动事件处理
	if(isContinue){
	if (e.wheelDelta > 0) {
		if (divNum > 0) {
			divNum -= 1;
		fadeOut(true, divNum);
		fadeIn(divNum);
		isContinue=false;
		setTimeout(function(){
		isContinue=true;
		},600);
		}
	} else if (divNum < 4) {
		
		divNum += 1;
		fadeOut(false, divNum);
		fadeIn(divNum);
		isContinue=false;
		setTimeout(function(){
		isContinue=true;
		},600);
	}
	}
}
function fadeIn(divInNum) {
	var numIn = 0;
	if (divInNum > 0) {
		for (var i = 0; i < divTalks.length; ++i) {
			divTalks[i].style.opacity = 0;
		}
		for (var i = 0; i <= 20; ++i) {
			setTimeout(function() {
				divTalks[divInNum - 1].style.opacity = (numIn += 0.05);
			}, i * 50);
		}
	}
}

function fadeOut(isUp, divOutNum) {
	var numOut = 1;
	if (isUp) {
		for (var i = 0; i <= 20; ++i) {
			setTimeout(function() {
				divTalks[divOutNum].style.opacity = (numOut -= 0.05);
			}, i * 10);
		}
	} else if (divOutNum > 1) {
		for (var i = 0; i <= 20; ++i) {
			setTimeout(function() {
				divTalks[divOutNum - 2].style.opacity = (numOut -= 0.05);
			}, i * 5);
		}
	}
}*/
function fadeInFirst() {
 var numIn = 0;
 for (var i = 0; i <= 20; ++i) {
  setTimeout(function() {
  document.getElementsByClassName('section')[0].style.opacity = (numIn += 0.05);
  }, i * 88);
 }
}
fadeInFirst();